package org.westos.demo;

public class lianxi3 {
    public static void main(String[] args) {
        String str="hfasdhfhaskdjfhkasdhkfjhsdkjfhaskjdfhakjsdhfkjashdfkj";
        int a=0;
        for (int i = 0; i < str.length(); i++) {
            for (int j =i+1; j < str.length(); j++) {
                char c = str.charAt(i);
                char c1 = str.charAt(j);
                if (c==c1){
                    int i1 = a - (j - i) > 0 ? a : (j - i);
                    System.out.println(a);
                }
            }
            System.out.println("=======================");
        }








       /* int a=0;
        int b=0;
        int d=0;
        for (int i = 1; i < str.length(); i++) {
            char c = str.charAt(a);
            char c1 = str.charAt(i);
            if (c==c1){
                b=i-a;
                int i1 = b - d > 0 ? b : d;
                d=i1;
                a=i;
            }
        }
        System.out.println(d);*/
    }
}
